<template>
	<view>
		
		<view class="list">
			<view class="uni-list">
				<view class="uni-list-cell" v-for="(item,index) in data" :key="index">
					<view  style="position: relative; width: 100%;color: #666;">
						<view style="height: 60upx;line-height: 90upx;padding-left: 20upx;font-size: 34upx;">
							{{item.log}}
						</view>
						<view style="height: 65upx;padding-left: 20upx;">
							<text style="background-color: #b71c24;color: #ffffff;font-size: 20upx;padding: 4upx 8upx 2upx;">日常签到</text>
							<text style="font-size: 20upx;padding-left: 14upx;">{{item.date}}</text>
						</view>
						<view class="act">
							+{{item.credit}}
						</view>
					</view>
				</view>
				<!-- <view class="uni-list-cell" @click="jump" data-src="sign/sign">
					<view class="uni-list-cell-navigate uni-navigate-right">
						<image src="../../static/addr.png" mode=""></image>
						<text class="text">金豆签到</text>
					</view>
				</view> -->
			</view>
		</view>
		
	</view>

</template>

<script>
	export default {
		data() {
			return {
				data:[],
				openid:'',
				
			};
		},
		onLoad:function(){
			uni.showLoading()
			uni.getStorage({
				key: 'openid',
				success: (res) => {
					this.openid = res.data
					this.setAjax()
				},
				fail: () => {
					uni.navigateTo({
						url: '../../login/login'
					});
				}
			});
		},
		methods:{
			setAjax(){
				uni.request({
					url: this.$BASE_URL+'/index.php?i=2&c=entry&m=ewei_shopv2&do=mobile&r=sign.getRecords&app=1&page=1',
					method: 'POST',
					data: {'openid':this.openid},
					header:{'Content-Type':'application/x-www-form-urlencoded'},
					success: res => {
						this.data = res.data.result.list
						uni.hideLoading()
						console.log(this.data)
					},
					fail: () => {},
					complete: () => {}
				});
				uni.hideLoading()
			},
		}
	}
</script>

<style>
	.act {
		position: absolute;
		top: 35upx;
		right: 30upx;
		color: #b71c24;
	}
	.uni-list-cell.active {background:#f5f5f5;}
	.uni-list image {width:34upx;height:34upx;}
	.uni-list .text {position:absolute;left:84upx;font-size:26upx;}
	.uni-list {margin-top:20upx;}
	.uni-list:before,.uni-list:after {display:none;}
	.uni-list-cell:after {content:" ";position:absolute;left:0.5rem;right:0.5rem;bottom:-1px;height:1px;border-top:1px solid #ebebeb;color:#D9D9D9;-webkit-transform-origin:0 0;-ms-transform-origin:0 0;transform-origin:0 0;-webkit-transform:scaleY(0.5);-ms-transform:scaleY(0.5);transform:scaleY(0.5);background:none;}
	.uni-list-cell .right {font-size:24upx;color:#999;margin-right:20upx;}
	.uni-list .uni-list-cell:last-child:after {border:0;}
	.uni-list .uni-badge {margin-right:15px;background-color:#f55;}
</style>
